﻿<sdk:ChildWindow x:Class="Apps.Yunwei.Views.ImageSelector"
                 xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"
                 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                 xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
                 Style="{StaticResource MetroChildWindow}"
                 Title="选择图片" Width="640" Height="400">
    <Grid x:Name="LayoutRoot">
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition Height="5"/>
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" MinHeight="36"/>
                <RowDefinition Height="Auto" MinHeight="36"/>
                <RowDefinition Height="Auto" MinHeight="36"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" MinWidth="55"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <TextBlock Text="图标" Grid.Row="0" Margin="2,6,4,0" VerticalAlignment="Top" TextAlignment="Right"/>
            <TextBlock Text="选择目录" Grid.Row="1" Margin="2,6,4,0" VerticalAlignment="Top" TextAlignment="Right"/>
            <!--<TextBlock Text="图标2" Grid.Row="1" Margin="2,6,4,0" VerticalAlignment="Top" TextAlignment="Right"/>
                 <TextBlock Text="图标3" Grid.Row="2" Margin="2,6,4,0" VerticalAlignment="Top" TextAlignment="Right"/>-->
            <TextBox Grid.Column="1" Grid.Row="0" Margin="2,2,0,4" Height="28"
                     x:Name="text"
                     Text="{Binding Icon1, Mode=TwoWay, ValidatesOnDataErrors=true}"/>
            <ComboBox Grid.Row="1" Grid.Column="1" x:Name="cmb"
                      Margin="2,2,0,4" Height="28"
                      SelectionChanged="ComboBox_SelectionChanged"/>
            <!--<TextBox Grid.Column="1" Grid.Row="1" Margin="2,2,0,4" Height="28"
                 Text="{Binding A5_ICON2, Mode=TwoWay, ValidatesOnDataErrors=true}"/>
                 <TextBox Grid.Column="1" Grid.Row="2" Margin="2,2,0,4" Height="28"
                 Text="{Binding A5_ICON3, Mode=TwoWay, ValidatesOnDataErrors=true}"/>-->
            <ListBox x:Name="list"  Grid.Row="2" Grid.RowSpan="2" Grid.ColumnSpan="2"
                     ScrollViewer.HorizontalScrollBarVisibility="Hidden"
                     SelectionChanged="list_SelectionChanged">
                <!--SelectedItem="{Binding A5_ICON1, Mode=TwoWay}"-->
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <Border BorderBrush="#49000000" Background="#49444444" BorderThickness="1">
                            <Image Source="{Binding}" Width="50" Height="50"/>
                        </Border>
                    </DataTemplate>
                </ListBox.ItemTemplate>
                <ListBox.ItemsPanel>
                    <ItemsPanelTemplate>
                        <toolkit:WrapPanel Width="590" />
                    </ItemsPanelTemplate>
                </ListBox.ItemsPanel>
            </ListBox>
            <toolkit:BusyIndicator x:Name="busyIndicator" Grid.ColumnSpan="2" Grid.Row="3"/>
        </Grid>
        <Button x:Name="OKButton" Content="确定"
                Click="OKButton_Click" Width="75" Height="23" Margin="0,0,79,0"
                HorizontalAlignment="Right" Grid.Row="2"/>
        <Button x:Name="CancelButton" Content="取消" 
                Click="CancelButton_Click" Width="75" Height="23"
                HorizontalAlignment="Right" Grid.Row="2"/>
    </Grid>
</sdk:ChildWindow>